from abc import abstractmethod


class Father:
  @abstractmethod#程序注解 告诉解释器是抽象方法 不能直接调用
  def greeting(self):
    print("Hello,Father")
    pass

class Son(Father):
  def greeting(self):
    print("Hello")

Jerry=Son()
Jerry.greeting()

class Son(Father):#继承Father
  def hello(self):
    print("Hello")

tom=Son()
tom.greeting()#Out: Hello,Father

class Son(Father):#继承Father
  def hello(self):
    print("Hello")
  def greeting(self):
    print("Hello")

tom=Son()
tom.greeting()#Out: 方法覆盖Father的greeting



def __init__ (self):#c自动调用的初始化 双下划线
  self.name="Tom"

